<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let num = +prompt('请输入一个数')
        let num2 = '0' + num
        document.write(num > 10 ? num : num2)
        //document.write (num >10 ? num : '0' + string(num))
    </script>
</body>
</html>